#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <math.h>

int how_dig(int num)
{
	int count = 0;
	while (num != 0)
	{
		num /= 10;
		count++;
	}
	return count;
}

int main()
{
	int a = 0;
	scanf("%d", &a);
	int dig = how_dig(a);
	int i = 0;
	int sum = 0;
	for (i = 1; i <= 5; i++)
	{
		sum += a * pow(pow(10, dig), 5 - i) * i;
	}
	printf("\n%d", sum);
	return 0;
}